package userRouter

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

func UserAuthRouter(r *gin.RouterGroup) {
	r.GET("/login", login)
	r.GET("/user/:id", func(context *gin.Context) {

	})

}

type LoginParamsDto struct {
	Username string `form:"username"` // 权限id
	Password string `form:"password"`
}

func login(c *gin.Context) {
	var loginParams LoginParamsDto
	err := c.ShouldBindQuery(&loginParams)
	if err == nil {
		fmt.Printf("%+v", loginParams)
		println(err)
	}

	c.JSON(http.StatusOK, gin.H{"res": "login"})
}
